'use strict';

module.exports = {
    // 在执行数据库升级时调用的函数，创建 users 表
    up: async (queryInterface, Sequelize) => {

        const {DECIMAL,DATE,INTEGER} = Sequelize;

        await queryInterface.createTable('t_audit', {
            id: { type: INTEGER, primaryKey: true, autoIncrement: true },
            agent_id: {type:DECIMAL(20),'allowNull': false},
            ad_id: {type:DECIMAL(20),'allowNull': false},
            createtime: {type:DATE,'allowNull': false},
            modifytime: {type:DATE,'allowNull': false},
            state: {type:DECIMAL(1),'allowNull': false},
        },{
            timestamps: false,  //去除createAt updateAt
            freezeTableName: true,  //使用自定义表名
        });
    },
    // 在执行数据库降级时调用的函数，删除 users 表
    down: async queryInterface => {
        await queryInterface.dropTable('t_audit');
    },
};
